

/*
// Definition for a Node.
class Node {
    int val;
    Node next;
    Node random;

    public Node(int val) {
        this.val = val;
        this.next = null;
        this.random = null;
    }
}
*/
// leetcode 138. 随机链表的复制
//class Solution {
//    public Node copyRandomList(Node head) {
//        if (head == null) return null;
//        Map<Node, Node> hash = new HashMap<>();
//        Node cur = head;
//        while (cur != null) {
//            Node node = new Node(cur.val);
//            hash.put(cur, node);
//            cur = cur.next;
//        }
//        Node dummy = hash.get(head);
//        cur = head;
//        while (cur != null) {
//            dummy.next = hash.get(cur.next);
//            dummy.random = hash.get(cur.random);
//            dummy = dummy.next;
//            cur = cur.next;
//        }
//        return hash.get(head);
//
//    }
//}